/* -----------------------------------------------------------------------
 * Paul Cohen
 * CS 362, Summer 2014
 * Assignment 3
 *
 * cardtest4.c - testing Dominion's Village card
 * 
 * -----------------------------------------------------------------------
 */

#include "cardtest4.h"
#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"
#include <string.h>
#include <stdio.h>

int card_test4()
{
	int seed = 1000;
	int numPlayers = 2;
	int beforeHandCount = 0;
	int beforeActions = 0;
	int successes = 0;

	int k[10] = {adventurer, council_room, feast, gardens, mine, remodel, smithy, village, baron, great_hall};

	struct gameState g;
	initializeGame(numPlayers, k, seed, &g);

	printf("\nCard Test 4: Village\n------------\n");  

	beforeHandCount = g.handCount[0];
	beforeActions = g.numActions;

	cardEffect(village, 0, 0, 0, &g, 1, 0);

	if (g.handCount[0] == beforeHandCount)
		successes++;
	else
		printf("Test failed - cards not gained and/or discarded correctly.\n");

	if (g.numActions == beforeActions + 2)
		successes++;
	else
		printf("Test failed - actions not added correctly.\n");

	if (g.playedCardCount == 1)
		successes++;
	else
		printf("Test failed - Village card not registered as played.\n");

	printf("Village tests completed!\n");
    printf("%d out of 3 tests successful.\n", successes);

	return 0;
}